import {reactive} from "vue";
import http from "../http";
const doctor = reactive({
    doctor_list: [],
    department_id: 1,
    doctor_id: 1,
    doctor_info: {},
    star_answer: {},
    illness_length: 0,


    get_doctor_list(){
        return http.get(`/doctor/doctor_list/${this.department_id}/`).then(response=>{
            this.doctor_list = response.data.data;
        })
    },
    get_doctor_info(id){
        return http.get(`/doctor/doctor_info/${id}/`).then(response=>{
            this.doctor_info = response.data;
        })
    },
    get_star_answer(id){
        return http.get(`/doctor/doctor_star_info/${id}/`).then(response=>{
            this.star_answer = response.data.data;
            console.log(this.star_answer)
        })
    },
    get_answer_length(id){
        return http.get(`/doctor/doctor_illness/${id}/`).then(response=>{
            this.illness_length = response.data.data.answer_length
            console.log(this.illness_length)
        })
    },
    get_doctor_list_by_department(id){
        return http.get(`/doctor/doctorList/${id}/`).then(response=>{
            this.doctor_list = response.data.data;
        })
    },

})

export default doctor;